<?php
	include_once("adb.php");
	
	class positions extends adb{
		function positions(){
			adb::adb();
		}
		/**
		*query all vaccines in the table and store the dataset in $this->result	
		*@return if successful true else false
		*/
		
		function get_all_positions(){
			$query="select * from Positions";
			return $this->query($query);
		}
		
		function add_positions($position_name,$position_created){
			//write the SQL query and call $this->query()
			$query="insert into Positions set position_name='$position_name',position_created=now()";
			return $this->query($query);
		}
		/**
		*updates the record identified by id 
		*/
		function update_positions($pid,$position_name,$position_created){
		 	//write the SQL query and call $this->query()
			$query="update Positions set position_name='$position_name',position_created=now() where pid=$pid";
			return $this->query($query);
		 }
		/**
		 *deletes the record identified by id 
		 */
		 function delete_positions($pid){
			//write the SQL query and call $this->query()
		 	$query="delete from Positions where pid=$pid";
		 	return $this->query($query);
		 }
		 function search($position_name){
		 	$query="select * from Positions where position_name like '%$position_name%'";
		 	return $this->query($query);
		 }
		 function get_position($pid){
		 	$query="select * from Positions where pid=$pid";
		 	return $this->query($query);
		 }
	}
	
	
?>